package com.inossem.warehousestorage_inossem.request.outStorage;

import android.content.Context;

import com.google.gson.Gson;
import com.inossem.warehousestorage_inossem.bean.outStorage.OutStorageOtherIndexBean;
import com.inossem.warehousestorage_inossem.constant.RequestConstant;
import com.inossem.warehousestorage_inossem.listener.GsonBeanListener;
import com.inossem.warehousestorage_inossem.listener.StringRequestListener;
import com.inossem.warehousestorage_inossem.manage.RequestManage;
import com.inossem.warehousestorage_inossem.model.StringResponse;
import com.inossem.warehousestorage_inossem.request.Request;

/**
 * 作者：wsy on 2017/12/7 11:56
 * <p>
 * 邮箱：445979770@qq.com
 */

public class OutStorageOtherIndexRequest extends Request {
    public static String request(Context context, GsonBeanListener gsonBeanListener) {
        String tag;
        String url = RequestManage.getUrl(context, RequestConstant.URL_OUT_STORAGE_OTHER_INDEX);
        tag = RequestManage.getHttpsGetWithLoading(context, url, new StringRequestListener() {
            @Override
            public void onSuccess(StringResponse stringRequestResponse) {
                Gson gson = new Gson();
                OutStorageOtherIndexBean bean = gson.fromJson(stringRequestResponse.getResponseInfo(), OutStorageOtherIndexBean.class);
                excuteJsonBeanNew(context, bean, gsonBeanListener);
            }
        });
        return tag;
    }
}
